
<!-- Groups -->
{% init show_groups = False %}
{% init groups = [] %}
{% init parent_id = "" %}

<div class="aside-item">
    <div class="aside-title">
        选项
    </div>
    <div class="aside-content">
        <ul>
        {% if _has_login %}
            <li><a class="link" href="/note/add">{{T('New_Note')}}</a></li>
            <li><a class="link" href="/note/recent_created">最新创建</a></li>
            <li><a class="link" href="/note/recent_edit">最近更新</a></li>
        {% end %}
            <li><a class="link" href="/note/public">分享笔记</a></li>
            <li><a class="link" href="/note/taglist">标签云</a></li>
            <!-- <li><a class="link" href="javascript:history.back()">返回</a></li> -->
        </ul>
    </div>
</div>

{% if _has_login and show_groups %}
<div class="aside-item">
    <div class="aside-title">
        分组
        {% if _has_login %}
        <a class="float-right link prompt-btn" message="新增分类" 
                    action="/note/add?type=group&name=">新增</a>
        {% end %}
    </div>
    <div class="aside-content">
        {% for item in groups %}
            <li><a class="link" href="/note/view?id={{item.id}}">{{item.name}}({{item.size}})</a></li>
        {% end %}
    </div>
</div>
{% end %}

{% init recent_created = [] %}
{% if len(recent_created) > 0 %}
<div class="aside-item">
    <div class="aside-title">
        最新文章
    </div>
    <div class="aside-content">
        {% for item in recent_created %}
            <li><a class="link" href="/note/view?id={{item.id}}">{{item.name}}</a></li>
        {% end %}
    </div>
</div>
{% end %}


{% init most_visited = [] %}
{% if len(most_visited) > 0 %}
<div class="aside-item">
    <div class="aside-title">
        最常访问
    </div>
    <div class="aside-content">
        {% for item in most_visited %}
            <li><a class="link" href="/note/view?id={{item.id}}">{{item.name}}</a></li>
        {% end %}
    </div>
</div>
{% end %}

{% init recommended_notes = [] %}
{% if len(recommended_notes) > 0 %}
<div class="aside-item">
    <div class="aside-title">
        推荐
    </div>
    <div class="aside-content">
        {% for item in recommended_notes %}
            {% if "url" in item %}
                <li><a class="link" href="{{item.url}}">{{item.name}}</a></li>
            {% else %}
                <li><a class="link" href="/note/view?id={{item.id}}">{{item.name}}</a></li>
            {% end %}
        {% end %}
    </div>
</div>
{% end %}
